using UnityEngine;

namespace FpFrame
{
    public static class TransitionFactory
    {
        public static IUITransitionEffect CreateEffect(TransitionSO so, Material fallbackMaterial = null)
        {
            if (so == null) throw new System.ArgumentNullException(nameof(so));

            switch (so.type)
            {
                case TransitionType.Dissolve:
                    return new DissolveTransition(so, fallbackMaterial);
                // case TransitionType.Wipe: return new WipeTransition(so);
                // case TransitionType.Blur: return new BlurTransition(so);
                default:
                    return new DissolveTransition(so, fallbackMaterial);
            }
        }
    }
}